home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / stabilzr.sit / The Stabilizer / card_3633.txt < prev    next >
Text File  |  1989-02-05  |  13KB  |  587 lines

  1. -- card: 3633 from stack: in
  2. -- bmap block id: 17605
  3. -- flags: 4000
  4. -- background id: 2175
  5. -- name: whichMonths
  6. ----- HyperTalk script -----
  7. on openCard
  8.   hide menuBar
  9.   global expenseAmount,expense
  10.   if expense = empty then
  11.     visual venetian blinds to gray
  12.     visual venetian blinds
  13.     pop card
  14.   else
  15.     if expenseAmount = "variable," then put " AND ENTER THE AMOUNT" after card field "chooseMonth"
  16.   end if
  17. end openCard
  18.  
  19. on closeCard
  20.   put "CLICK ON THE MONTHS YOU PAY THIS EXPENSE" into card field "chooseMonth"
  21. end closeCard
  22.  
  23. on monthInfo
  24.   global expenseAmount
  25.   if expenseAmount = "variable," then
  26.     repeat with i = 1 to 12
  27.       if the visible of card field i = true and card field i = "$" then
  28.         if the name of button i = the name of the target then exit repeat
  29.         beep
  30.         repeat 4
  31.           set the hiLite of button i to not the hiLite of button i
  32.         end repeat
  33.         click at the loc of card field i
  34.         exit monthInfo
  35.       end if
  36.     end repeat
  37.   end if
  38.   get the short name of the target
  39.   set the hiLite of the target to not the hiLite of the target
  40.   if the hiLite of the target is true and expenseAmount = "variable,"
  41.   then
  42.   show card field it
  43.   click at the loc of card field it
  44.   type "$"
  45. else
  46.   put empty into card field it
  47.   hide card field it
  48. end if
  49. end monthInfo
  50.  
  51.  
  52.  
  53.  
  54. -- part 4 (button)
  55. -- low flags: 00
  56. -- high flags: 0000
  57. -- rect: left=10 top=35 right=117 bottom=120
  58. -- title width / last selected line: 0
  59. -- icon id / first selected line: 0 / 0
  60. -- text alignment: 1
  61. -- font id: 0
  62. -- text size: 12
  63. -- style flags: 0
  64. -- line height: 16
  65. -- part name: January
  66. ----- HyperTalk script -----
  67. on mouseUp
  68.   monthInfo
  69. end mouseUp
  70.  
  71.  
  72.  
  73. -- part 6 (button)
  74. -- low flags: 00
  75. -- high flags: 0000
  76. -- rect: left=136 top=35 right=117 bottom=246
  77. -- title width / last selected line: 0
  78. -- icon id / first selected line: 0 / 0
  79. -- text alignment: 1
  80. -- font id: 0
  81. -- text size: 12
  82. -- style flags: 0
  83. -- line height: 16
  84. -- part name: February
  85. ----- HyperTalk script -----
  86. on mouseUp
  87.   monthInfo
  88. end mouseUp
  89.  
  90.  
  91.  
  92. -- part 7 (button)
  93. -- low flags: 00
  94. -- high flags: 0000
  95. -- rect: left=264 top=35 right=117 bottom=374
  96. -- title width / last selected line: 0
  97. -- icon id / first selected line: 0 / 0
  98. -- text alignment: 1
  99. -- font id: 0
  100. -- text size: 12
  101. -- style flags: 0
  102. -- line height: 16
  103. -- part name: March
  104. ----- HyperTalk script -----
  105. on mouseUp
  106.   monthInfo
  107. end mouseUp
  108.  
  109.  
  110.  
  111. -- part 8 (button)
  112. -- low flags: 00
  113. -- high flags: 0000
  114. -- rect: left=391 top=35 right=117 bottom=501
  115. -- title width / last selected line: 0
  116. -- icon id / first selected line: 0 / 0
  117. -- text alignment: 1
  118. -- font id: 0
  119. -- text size: 12
  120. -- style flags: 0
  121. -- line height: 16
  122. -- part name: April
  123. ----- HyperTalk script -----
  124. on mouseUp
  125.   monthInfo
  126. end mouseUp
  127.  
  128.  
  129.  
  130. -- part 9 (button)
  131. -- low flags: 00
  132. -- high flags: 0000
  133. -- rect: left=10 top=130 right=212 bottom=120
  134. -- title width / last selected line: 0
  135. -- icon id / first selected line: 0 / 0
  136. -- text alignment: 1
  137. -- font id: 0
  138. -- text size: 12
  139. -- style flags: 0
  140. -- line height: 16
  141. -- part name: May
  142. ----- HyperTalk script -----
  143. on mouseUp
  144.   monthInfo
  145. end mouseUp
  146.  
  147.  
  148.  
  149. -- part 10 (button)
  150. -- low flags: 00
  151. -- high flags: 0000
  152. -- rect: left=136 top=130 right=212 bottom=246
  153. -- title width / last selected line: 0
  154. -- icon id / first selected line: 0 / 0
  155. -- text alignment: 1
  156. -- font id: 0
  157. -- text size: 12
  158. -- style flags: 0
  159. -- line height: 16
  160. -- part name: June
  161. ----- HyperTalk script -----
  162. on mouseUp
  163.   monthInfo
  164. end mouseUp
  165.  
  166.  
  167.  
  168. -- part 11 (button)
  169. -- low flags: 00
  170. -- high flags: 0000
  171. -- rect: left=264 top=130 right=212 bottom=374
  172. -- title width / last selected line: 0
  173. -- icon id / first selected line: 0 / 0
  174. -- text alignment: 1
  175. -- font id: 0
  176. -- text size: 12
  177. -- style flags: 0
  178. -- line height: 16
  179. -- part name: July
  180. ----- HyperTalk script -----
  181. on mouseUp
  182.   monthInfo
  183. end mouseUp
  184.  
  185.  
  186.  
  187. -- part 12 (button)
  188. -- low flags: 00
  189. -- high flags: 0000
  190. -- rect: left=391 top=130 right=212 bottom=501
  191. -- title width / last selected line: 0
  192. -- icon id / first selected line: 0 / 0
  193. -- text alignment: 1
  194. -- font id: 0
  195. -- text size: 12
  196. -- style flags: 0
  197. -- line height: 16
  198. -- part name: August
  199. ----- HyperTalk script -----
  200. on mouseUp
  201.   monthInfo
  202. end mouseUp
  203.  
  204.  
  205.  
  206. -- part 13 (button)
  207. -- low flags: 00
  208. -- high flags: 0000
  209. -- rect: left=10 top=228 right=310 bottom=120
  210. -- title width / last selected line: 0
  211. -- icon id / first selected line: 0 / 0
  212. -- text alignment: 1
  213. -- font id: 0
  214. -- text size: 12
  215. -- style flags: 0
  216. -- line height: 16
  217. -- part name: September
  218. ----- HyperTalk script -----
  219. on mouseUp
  220.   monthInfo
  221. end mouseUp
  222.  
  223.  
  224.  
  225. -- part 14 (button)
  226. -- low flags: 00
  227. -- high flags: 0000
  228. -- rect: left=136 top=228 right=310 bottom=246
  229. -- title width / last selected line: 0
  230. -- icon id / first selected line: 0 / 0
  231. -- text alignment: 1
  232. -- font id: 0
  233. -- text size: 12
  234. -- style flags: 0
  235. -- line height: 16
  236. -- part name: October
  237. ----- HyperTalk script -----
  238. on mouseUp
  239.   monthInfo
  240. end mouseUp
  241.  
  242.  
  243.  
  244. -- part 15 (button)
  245. -- low flags: 00
  246. -- high flags: 0000
  247. -- rect: left=264 top=228 right=310 bottom=374
  248. -- title width / last selected line: 0
  249. -- icon id / first selected line: 0 / 0
  250. -- text alignment: 1
  251. -- font id: 0
  252. -- text size: 12
  253. -- style flags: 0
  254. -- line height: 16
  255. -- part name: November
  256. ----- HyperTalk script -----
  257. on mouseUp
  258.   monthInfo
  259. end mouseUp
  260.  
  261.  
  262.  
  263. -- part 16 (button)
  264. -- low flags: 00
  265. -- high flags: 0000
  266. -- rect: left=391 top=228 right=310 bottom=501
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 1
  270. -- font id: 0
  271. -- text size: 12
  272. -- style flags: 0
  273. -- line height: 16
  274. -- part name: December
  275. ----- HyperTalk script -----
  276. on mouseUp
  277.   monthInfo
  278. end mouseUp
  279.  
  280.  
  281.  
  282. -- part 17 (field)
  283. -- low flags: 80
  284. -- high flags: 0001
  285. -- rect: left=26 top=75 right=92 bottom=104
  286. -- title width / last selected line: 0
  287. -- icon id / first selected line: 0 / 0
  288. -- text alignment: 0
  289. -- font id: 0
  290. -- text size: 12
  291. -- style flags: 0
  292. -- line height: 16
  293. -- part name: January
  294.  
  295.  
  296. -- part 18 (field)
  297. -- low flags: 80
  298. -- high flags: 0001
  299. -- rect: left=152 top=75 right=92 bottom=230
  300. -- title width / last selected line: 0
  301. -- icon id / first selected line: 0 / 0
  302. -- text alignment: 0
  303. -- font id: 0
  304. -- text size: 12
  305. -- style flags: 0
  306. -- line height: 16
  307. -- part name: February
  308.  
  309.  
  310. -- part 19 (field)
  311. -- low flags: 80
  312. -- high flags: 0001
  313. -- rect: left=280 top=75 right=92 bottom=358
  314. -- title width / last selected line: 0
  315. -- icon id / first selected line: 0 / 0
  316. -- text alignment: 0
  317. -- font id: 0
  318. -- text size: 12
  319. -- style flags: 0
  320. -- line height: 16
  321. -- part name: March
  322.  
  323.  
  324. -- part 20 (field)
  325. -- low flags: 80
  326. -- high flags: 0001
  327. -- rect: left=407 top=75 right=92 bottom=485
  328. -- title width / last selected line: 0
  329. -- icon id / first selected line: 0 / 0
  330. -- text alignment: 0
  331. -- font id: 0
  332. -- text size: 12
  333. -- style flags: 0
  334. -- line height: 16
  335. -- part name: April
  336.  
  337.  
  338. -- part 21 (field)
  339. -- low flags: 80
  340. -- high flags: 0001
  341. -- rect: left=26 top=170 right=187 bottom=104
  342. -- title width / last selected line: 0
  343. -- icon id / first selected line: 0 / 0
  344. -- text alignment: 0
  345. -- font id: 0
  346. -- text size: 12
  347. -- style flags: 0
  348. -- line height: 16
  349. -- part name: May
  350.  
  351.  
  352. -- part 22 (field)
  353. -- low flags: 80
  354. -- high flags: 0001
  355. -- rect: left=152 top=170 right=187 bottom=230
  356. -- title width / last selected line: 0
  357. -- icon id / first selected line: 0 / 0
  358. -- text alignment: 0
  359. -- font id: 0
  360. -- text size: 12
  361. -- style flags: 0
  362. -- line height: 16
  363. -- part name: June
  364.  
  365.  
  366. -- part 23 (field)
  367. -- low flags: 80
  368. -- high flags: 0001
  369. -- rect: left=280 top=170 right=187 bottom=358
  370. -- title width / last selected line: 0
  371. -- icon id / first selected line: 0 / 0
  372. -- text alignment: 0
  373. -- font id: 0
  374. -- text size: 12
  375. -- style flags: 0
  376. -- line height: 16
  377. -- part name: July
  378.  
  379.  
  380. -- part 24 (field)
  381. -- low flags: 80
  382. -- high flags: 0001
  383. -- rect: left=407 top=170 right=187 bottom=485
  384. -- title width / last selected line: 0
  385. -- icon id / first selected line: 0 / 0
  386. -- text alignment: 0
  387. -- font id: 0
  388. -- text size: 12
  389. -- style flags: 0
  390. -- line height: 16
  391. -- part name: August
  392.  
  393.  
  394. -- part 25 (field)
  395. -- low flags: 80
  396. -- high flags: 0001
  397. -- rect: left=26 top=268 right=285 bottom=104
  398. -- title width / last selected line: 0
  399. -- icon id / first selected line: 0 / 0
  400. -- text alignment: 0
  401. -- font id: 0
  402. -- text size: 12
  403. -- style flags: 0
  404. -- line height: 16
  405. -- part name: September
  406.  
  407.  
  408. -- part 26 (field)
  409. -- low flags: 80
  410. -- high flags: 0001
  411. -- rect: left=152 top=268 right=285 bottom=230
  412. -- title width / last selected line: 0
  413. -- icon id / first selected line: 0 / 0
  414. -- text alignment: 0
  415. -- font id: 0
  416. -- text size: 12
  417. -- style flags: 0
  418. -- line height: 16
  419. -- part name: October
  420.  
  421.  
  422. -- part 27 (field)
  423. -- low flags: 80
  424. -- high flags: 0001
  425. -- rect: left=280 top=268 right=285 bottom=358
  426. -- title width / last selected line: 0
  427. -- icon id / first selected line: 0 / 0
  428. -- text alignment: 0
  429. -- font id: 0
  430. -- text size: 12
  431. -- style flags: 0
  432. -- line height: 16
  433. -- part name: November
  434.  
  435.  
  436. -- part 28 (field)
  437. -- low flags: 80
  438. -- high flags: 0001
  439. -- rect: left=407 top=269 right=286 bottom=485
  440. -- title width / last selected line: 0
  441. -- icon id / first selected line: 0 / 0
  442. -- text alignment: 0
  443. -- font id: 0
  444. -- text size: 12
  445. -- style flags: 0
  446. -- line height: 16
  447. -- part name: December
  448.  
  449.  
  450. -- part 29 (field)
  451. -- low flags: 00
  452. -- high flags: 0002
  453. -- rect: left=25 top=11 right=28 bottom=485
  454. -- title width / last selected line: 0
  455. -- icon id / first selected line: 0 / 0
  456. -- text alignment: 1
  457. -- font id: 0
  458. -- text size: 12
  459. -- style flags: 0
  460. -- line height: 16
  461. -- part name: ChooseMonth
  462.  
  463.  
  464. -- part 30 (button)
  465. -- low flags: 00
  466. -- high flags: 2000
  467. -- rect: left=172 top=313 right=341 bottom=249
  468. -- title width / last selected line: 0
  469. -- icon id / first selected line: 0 / 0
  470. -- text alignment: 1
  471. -- font id: 0
  472. -- text size: 12
  473. -- style flags: 0
  474. -- line height: 16
  475. -- part name: OK
  476. ----- HyperTalk script -----
  477. on mouseUp
  478.   global expenseAmount,expense,moreExpenses
  479.   set numberFormat to "0.00"
  480.   set cursor to 4
  481.   put loc of msg into saveMsg
  482.   set loc of msg to 18,69
  483.   put "Please wait"
  484.   repeat with i = 1 to 12
  485.     if the hiLite of button i is true then
  486.       get the short name of button i
  487.       put it into month
  488.       put month & "," after expense
  489.       if expenseAmount ="variable," then
  490.         delete last char of expense
  491.         get card field i
  492.         if it = "$" or it = empty then ask "Please enter the amount for " & month
  493.         if it = empty then
  494.           delete last item of expense
  495.           put "," after expense
  496.         else
  497.           if char 1 of it = "$" then delete char 1 of it
  498.           if last char of it = "$" then delete last char of it
  499.           if last char of it = return then delete line 2 of it
  500.           if last char of it = return then delete last char of it
  501.           repeat
  502.             if "," is in it then
  503.               put offset (",",it) into er
  504.               delete char er of it
  505.             else
  506.               exit repeat
  507.             end if
  508.           end repeat
  509.           add 0 to it
  510.           put " - "& "$" & it & "," after expense
  511.         end if
  512.       end if
  513.       hide card field i
  514.       put empty into card field i
  515.       set hiLite of button i to false
  516.     end if
  517.   end repeat
  518.   delete last char of expense
  519.   hide msg
  520.   set loc of msg to saveMsg
  521.   visual venetian blinds to gray
  522.   visual venetian blinds
  523.   pop card
  524.   put 1 into moreExpenses
  525.   doAlphabet
  526.   answer "Are you finished adding expenses?" with "Yes" or "No"
  527.   if it = "yes" then noMore
  528. end mouseUp
  529.  
  530.  
  531.  
  532. -- part 31 (button)
  533. -- low flags: 00
  534. -- high flags: 2000
  535. -- rect: left=259 top=316 right=338 bottom=329
  536. -- title width / last selected line: 0
  537. -- icon id / first selected line: 0 / 0
  538. -- text alignment: 1
  539. -- font id: 0
  540. -- text size: 12
  541. -- style flags: 0
  542. -- line height: 16
  543. -- part name: Cancel
  544. ----- HyperTalk script -----
  545. on mouseUp
  546.   global expense,moreExpenses
  547.   answer "Cancel the months selected or the expense item?" with "Expense" or "Months"
  548.   set cursor to 4
  549.   if it = "Expense" then
  550.     put empty into expense
  551.   end if
  552.   put 1 into i
  553.   repeat 12 times
  554.     if the hiLite of button i = true then
  555.       hide card field i
  556.       set the hiLite of button i to false
  557.       put empty into card field i
  558.     end if
  559.     add 1 to i
  560.   end repeat
  561.   if it = "Expense" then
  562.     visual venetian blinds to gray
  563.     visual venetian blinds
  564.     pop card
  565.     put 1 into moreExpenses
  566.   end if
  567. end mouseUp
  568.  
  569.  
  570.  
  571. -- part 32 (field)
  572. -- low flags: 80
  573. -- high flags: 0007
  574. -- rect: left=9 top=26 right=329 bottom=498
  575. -- title width / last selected line: 0
  576. -- icon id / first selected line: 0 / 0
  577. -- text alignment: 0
  578. -- font id: 3
  579. -- text size: 12
  580. -- style flags: 0
  581. -- line height: 16
  582. -- part name: allExpenses
  583.  
  584.  
  585. -- part contents for card part 29
  586. ----- text -----
  587. CLICK ON THE MONTHS YOU PAY THIS EXPENSE